www.mxdraw.com
|
从文件加载图案定义
[helpstring("method LoadPatternDefinition")] HRESULT LoadPatternDefinition([in] BSTR pszFileName, [in] BSTR pszName, [in] DOUBLE dPatternScale, [in] DOUBLE dPatternAngel, [out,retval] VARIANT_BOOL* pOk);
参数 |
说明 |
[in] BSTR pszFileName |
图案定义文件 |
[in] BSTR pszName |
图案名称 |
[in] DOUBLE dPatternScale |
缩放比例,默认传1.0 dPatternAngel -角度,默认传0.0; |
成功返回true.
例如: C# 从文件加载图案
MxDrawUiPrPoint getPoint = new MxDrawUiPrPoint(); getPoint.message = "点取一点:"; if (getPoint.go() != MCAD_McUiPrStatus.mcOk) return; MxDrawPoint pt = getPoint.value(); axMxDrawX1.PatternDefinition = "SOLID"; Int64 id = axMxDrawX1.DrawHatchFromPoint(pt.x, pt.y, 1.0); if (id == 0) return; // 修改新绘的填充的图案从文件中加载. String sPatternFile = axMxDrawX1.GetOcxAppPath() + "\mx.pat"; String sPatternName = "ANSI35"; MxDrawHatch hatch = (MxDrawHatch)axMxDrawX1.ObjectIdToObject(id); hatch.LoadPatternDefinition(sPatternFile, sPatternName, 300.0, 0.0);